package cn.mesmile.h2.service.impl;

import cn.mesmile.h2.entity.Student;
import cn.mesmile.h2.mapper.StudentMapper;
import cn.mesmile.h2.service.StudentService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author zb
 * @date 2021/11/22 10:28
 * @Description
 */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.SUPPORTS, readOnly = true)
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {

    @Override
    public List<Student> listStudent() {
        return list();
    }

    @Override
    public Student updateStudent(Student student) {
        boolean b = updateById(student);
        return student;
    }
}
